#include <iostream>
using std::cout;
using std::endl;

#define PI 3.14

class Circle
{
public:
    Circle()
    : _r(0)
    {}

    Circle(double r)
    : _r(r)
    {}

    double getArea(){
        return _r * _r * PI;
    }
    double getPerimeter(){
        return 2 * _r * PI;
    }
    void show(){
        cout << "圆的半径:" << _r << endl;
        cout << "圆的周长:" << getPerimeter() << endl;
        cout << "圆的面积:" << getArea() << endl;
    }
private:
    double _r;
};

class Cylinder
: public Circle
{
public:
    Cylinder(double r,double h)
    : Circle(r)
    , _h(h)
    {}

    double getVolume(){
        return getArea() * _h;
    }

    void showVolume(){
        show();
        cout << "圆柱体的体积:" << getVolume() << endl;
    }
private:
    double _h;
};


void test0(){
    Cylinder cy(2,10);
    cy.showVolume();
}

int main(void){
    test0();
    return 0;
}
